package sy.po;

import java.util.List;

import org.nutz.dao.entity.annotation.ColDefine;
import org.nutz.dao.entity.annotation.ColType;
import org.nutz.dao.entity.annotation.Column;
import org.nutz.dao.entity.annotation.Comment;
import org.nutz.dao.entity.annotation.Many;
import org.nutz.dao.entity.annotation.Table;

/**
 * 
 * @author 孙宇
 *
 */
@Table("t_resource")
@Comment("资源表")
public class Resource extends BaseModel {

	@Column
	@Comment("资源名称")
	@ColDefine(width = 100, notNull = true)
	private String name;

	@Column
	@Comment("父资源")
	private String pid;

	@Column
	@Comment("资源地址")
	@ColDefine(width = 200)
	private String url;

	@Column
	@Comment("排序")
	@ColDefine(type = ColType.INT)
	private Integer seq = 1000;

	@Column
	@Many(field = "pid", target = Resource.class)
	private List<Resource> resources;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getPid() {
		return pid;
	}

	public void setPid(String pid) {
		this.pid = pid;
	}

	public List<Resource> getResources() {
		return resources;
	}

	public void setResources(List<Resource> resources) {
		this.resources = resources;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public Integer getSeq() {
		return seq;
	}

	public void setSeq(Integer seq) {
		this.seq = seq;
	}

}
